package com.heima.media.config;

import com.heima.media.interceptor.MediaInterceptor;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
@ComponentScan(value = {
        "com.heima.common.knife4j",
        "com.heima.common.minio",
        "com.heima.common.exception",
        "com.heima.common.aliyun",
        "com.heima.media.feign"})
public class InitConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new MediaInterceptor())
                .addPathPatterns("/**"); // 拦截所有
    }
}